package org.business.accounting.service;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.business.accounting.interfaces.BasicOrder;

public class OrderDAOImpl implements OrderDAO {
	
	private Map<Long, BasicOrder> orders;
	
	public OrderDAOImpl() {
		orders = new HashMap<Long, BasicOrder>();
	}
	
	public void save(BasicOrder basicOrder) {
		orders.put(basicOrder.getId(), basicOrder);
	}
	
	public BasicOrder remove(long key) {
		return orders.remove(key);
	}
	
	public Collection<BasicOrder> retreive() {
		return orders.values();
	}
	
	public BasicOrder get(long key) {
		return orders.get(key);
	}

}
